title
:How to setup NIP-05 verification using Github Pages - Patrick Ulrich
categories
:reprint
tags
:blockchain
excerpt
:setup NIP-05 verification using Github Pages
toc
:true
date
:2022-12-23 20:33:36
cover
:
comments
: false
aubot
:Patrick Ulrich
aubot_link
:
NIP-05, also known as NIP05 or NIP5, is a Nostr Improvement Proposal that outlines a process for mapping Nostr keys to DNS-based internet identifiers. This allows users to associate their Nostr public keys with a human-readable internet address, such as “mycooluser@mydomain.com”. This makes it easier for users to find and follow each other on Nostr, as well as allows for more intuitive and user-friendly displays of identifiers in Nostr clients.
To set up NIP5 verification using Github Pages, you will need to follow these steps:
Set up your domain records
To set up domain records for your website, it is crucial to have a domain name that you have control over. In case you don’t own one, you can easily purchase one on Porkbun.com at a reasonable price per year.
Once you have your domain name, the next step is to configure your domain’s DNS (Domain Name System) records to work with GitHub Pages. GitHub Pages is a platform that allows you to host your website for free. To do this, you will need to add A records to your domain’s DNS settings. These A records should be set up as follows:
| Type | Host | Answer | TTL | Priority |
|------|----------------|-----------------|-----|----------|
| A | YOURDOMAIN.COM | 185.199.108.153 | 300 | |
| A | YOURDOMAIN.COM | 185.199.109.153 | 300 | |
| A | YOURDOMAIN.COM | 185.199.110.153 | 300 | |
| A | YOURDOMAIN.COM | 185.199.111.153 | 300 | |
Having the correct DNS records in place is essential to ensuring that your website is accessible to visitors. By following these steps, you will be able to set up your domain records correctly and start hosting your website on GitHub Pages in no time.
Create your GitHub repository
Setting up a Github repository is a simple and straightforward process, and is an essential step in hosting your NIP5 verification file on the web. To begin, create a new Github repository specifically for this purpose.
Once you have created your repository, you will need to add a new file to it called “.well-known/nostr.json”. This file will hold the mapping of your Nostr public key to your internet identifier, and is a critical component of the NIP5 verification process.
To edit your nostr.json file, you will need to include your public key in hex format, as well as your desired nickname for your identifier. If your public key is in the format “npub1…”, you can convert it to hex using Damus’ tool. You can use my NIP-05 as a template:
{
"names": {
"_": "0f563fe2cfdf180cb104586b95873379a0c1fdcfbc301a80c8255f33d15f039d"
}
}
Simply replace the provided public key with your own, and adjust the nickname as desired. If you would like to be identified simply as mydomain.com”, you can leave the nickname as is. If you prefer a more personalized identifier, such as “mycooluser@mydomain.com“, replace the _ with your desired nickname mycooluser.
Finally, create a new file in the root folder of your repository called “_config.yml”. This file should contain a single line:
include: [".well-known"]
This line tells Github to include the “.well-known” directory in your repository when it is served as a static website, ensuring that your NIP5 verification file is accessible and correctly formatted.
Deploying your repository
Deploying your Github repository is the final step in hosting your NIP5 verification file on the web. To begin, navigate to the settings page for your repository and select the “Pages” tab.
Under the “Build and deployment” section, select “Deploy from branch” and choose the “Main/Master” branch. This tells Github to build and serve your repository as a static website using the files contained in the “Main/Master” branch.
Next, under “Custom domain”, type in your domain name, for example “mydomain.com”. Github may provide a warning, but you can safely ignore this.
Finally, ensure that the “Enforce HTTPS” option is selected. This will ensure that your website is served over a secure connection, providing added protection and security for your NIP5 verification file.
With these steps completed, your repository is now deployed and ready to be used as the basis for your NIP5 verification file. You can now take advantage of the reliability and scalability that Github has to offer while enjoying the benefits of hosting your NIP5 verification file on the web.
Updating Nostr
Updating your Nostr profile is a simple process that helps you associate your Nostr public key with your internet identifier. To finalize this process, navigate to the settings page of a Nostr client that supports NIP5, such as metadata.nostr.com, astral.ninja, or Snort.social.
Once you have accessed the settings page, you can edit the NIP-05 Identifier field to reflect your desired internet identifier. For example, if you previously chose “mycooluser@mydomain.com” as your identifier in step 5, you will want to enter this into the NIP-05 Identifier field.
After you have updated the field, simply press “Save” to finalize the process and broadcast the message. This will associate your Nostr public key with your internet identifier, ensuring that your NIP5 verification file is properly linked to your profile and that it is accessible to others on the web.
With these steps completed, your Nostr profile is now up-to-date and ready to be used as the basis for your NIP5 verification file. You should now be able to use your NIP5 internet identifier on Nostr and easily find and follow other users.